#include <QBitmap>
#include <QDebug>

#include "About.h"
#include "ui_About.h"

About::About(QWidget *parent) :
    QDialog(parent, Qt::FramelessWindowHint),
    m_ui(new Ui::About)
{
    m_ui->setupUi(this);
    QPixmap pixmap(":/about.png");
    setMask(pixmap.mask());
    setModal(true);
}

About::~About()
{
    delete m_ui;
}

void About::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void About::mousePressEvent(QMouseEvent *event)
{
    lastPos = event->globalPos();
}

void About::mouseMoveEvent(QMouseEvent *event)
{
    move(pos() + event->globalPos() - lastPos);
    lastPos = event->globalPos();
}
